package com.cheng.xbsc.service.impl;

import com.cheng.xbsc.entity.SysOrder;
import com.cheng.xbsc.mapper.SysOrderMapper;
import com.cheng.xbsc.service.SysOrderService;
import com.cheng.xbsc.util.LoginUserUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysOrderServiceImpl implements SysOrderService {

    @Autowired
    private SysOrderMapper sysOrderMapper;


    @Override
    public List<SysOrder> findByStatus(String status) {
        return sysOrderMapper.findByStatus(LoginUserUtil.getUserId(), status);
    }

    @Override
    public void updateStatus(Integer orderId, String status) {
        sysOrderMapper.updateStatusById(orderId, status);
    }
}
